home *** CD-ROM | disk | FTP | other *** search
- ;
- ; Script to install SMail
- ;
- ;=================== init ===============
-
- (complete 0)
- (set default-dest "uucp:c")
- (set @app-name "SMail")
- (set @default-dest "UUCP:C")
- (set need-version 37)
-
- (welcome " Welcome to " @app-name " installation.\n")
-
- (set exec-version (/ (getversion) 65536))
- (if (< exec-version need-version) ; check operating system version
- ((message @app-name " needs at least Exec version " need-version
- " to run.\nYou have only version " exec-version ".\n"
- "You can proceed with the installation, but consider "
- "installing the " @app-name " with proper version of "
- "the operating system."
- (help
- " The " @app-name " uses some system functions "
- "that are not present or functional in earlier system "
- "versions. Consider updating your system.\n"
- " If you have a later version of operating system "
- "and are only now using older version: be sure to use "
- "only release 2.04 or newer with " @app-name ". "
- "No damage happens if you run " @app-name " with an "
- "earlier operating system, however. It just "
- "refuses to start.\n"))))
-
- ;=================== search assings ==========
- (if (= @user-level 2)
- (set UULIB
- (askdir
- (prompt "Where do you keep your uucp configs ?")
- (help @askdir-help)
- (default "UULIB:")
- )
- )
- (set UULIB "UULIB:")
- )
-
-
- (if (= @user-level 2)
- (set UUBIN
- (askdir
- (prompt "Where do you keep your uucp binarys ?")
- (help @askdir-help)
- (default "UUCP:C")
- )
- )
- (set UUBIN "UUCP:C")
- )
-
- (if (= @user-level 2)
- (set UUSPOOL
- (askdir
- (prompt "Where do you keep your uucp spool files ?")
- (help @askdir-help)
- (default "UUSPOOL:")
- )
- )
- (set UUSPOOL "UUSPOOL:")
- )
- (set @default-dest UUBIN)
-
- (set sendmail (tackon UUBIN "sendmail"))
- (set rmail (tackon UUBIN "rmail"))
- (set mail (tackon UUBIN "mail"))
- (set smail (tackon UUBIN "smail"))
- (set rsmtp (tackon UUBIN "rsmtp"))
- (set rcsmtp (tackon UUBIN "rcsmtp"))
- (set rfsmtp (tackon UUBIN "rfsmtp"))
- (set batch_smtp (tackon UUBIN "batch_smtp"))
-
- ;================= backup existings files ==========
- (set backup (askbool
- (prompt " Do you want to backup your existing "sendmail","rmail","rcsmtp
- "," rfsmtp" and "rsmtp" to T:")
- (choices "Proceed" "Skip this Part")
- (default 0)
- (help "none available :-(")
- ))
-
- (if (= backup 1)
- (
- (if (exists mail)
- (copyfiles
- (prompt "Backup original programs from " UUBIN)
- (help @copyfiles-help)
- (source mail)
- (dest "t:")
- (infos)
- (confirm)
- )
- )
-
- (if (exists rsmtp)
- (copyfiles
- (prompt "Backup original programs from " UUBIN)
- (help @copyfiles-help)
- (source rsmtp)
- (dest "t:")
- (infos)
- (confirm)
- )
- )
-
- (if (exists rcsmtp)
- (copyfiles
- (prompt "Backup original programs from " UUBIN)
- (help @copyfiles-help)
- (source rcsmtp)
- (dest "t:")
- (infos)
- (confirm)
- )
- )
-
- (if (exists rfsmtp)
- (copyfiles
- (prompt "Backup original programs from " UUBIN)
- (help @copyfiles-help)
- (source rfsmtp)
- (dest "t:")
- (infos)
- (confirm)
- )
- )
-
- (if (exists rmail)
- (copyfiles
- (prompt "Backup original programs from " UUBIN)
- (help @copyfiles-help)
- (source rmail)
- (dest "t:")
- (infos)
- (confirm)
- )
- )
-
- (if (exists sendmail)
- (copyfiles
- (prompt "Backup original programs from " UUBIN)
- (help @copyfiles-help)
- (source sendmail)
- (dest "t:")
- (infos)
- (confirm)
- )
- )
-
- (if (exists batch_smtp)
- (copyfiles
- (prompt "Backup original programs from " UUBIN)
- (help @copyfiles-help)
- (source batch_smtp)
- (dest "t:")
- (infos)
- (confirm)
- )
- )))
-
- ;================ delete old files ================
- (complete 20)
-
- (debug (run (cat "delete force "mail)))
- (debug (run (cat "delete force "smail)))
- (debug (run (cat "delete force "rsmtp)))
- (debug (run (cat "delete force "rcsmtp)))
- (debug (run (cat "delete force "rfsmtp)))
- (debug (run (cat "delete force "sendmail)))
-
- ;================ copy files to uubin =============
- (complete 25)
- (copylib
- (prompt "copy netsupport.library")
- (help @copylib-help)
- (source "libs/netsupport.library")
- (dest "libs:")
- (confirm)
- )
-
- (set axsh 0)
- (set choice (askchoice
- (prompt " Do you want to install the AXSh versions of SMail/RMail ?")
- (choices "Getty" "AXSh" "MultiUserFilesystem")
- (default 0)
- (help "Getty\n"
- "Insert all users of your site in getty:passwd. Insert in "
- "the comment part the realname of the user.This is only "
- "important for the Realname if you donnot use the local "
- "enviroment variable REALNAME. Besides smail takes the home-directory "
- "for `Mail forwarding' from the getty's passwd.\n"
- "AXSh\n"
- "These programs use the AXSh passwd instead of Gettys passwd.\n"
- "MUFS\n"
- "These programs use the MUFS passwd instead of Gettys passwd.")))
- (if (= choice 0)
- (copyfiles
- (prompt "Install Getty programs...")
- (help @copyfiles-help)
- (source "bin")
- (dest UUBIN)
- (choices "smail" "mail" "convert" "batch_smtp")
- (infos)
- (confirm))
- )
-
- (if (= choice 1)
- (
- (copyfiles
- (prompt "Install AXSh programs...")
- (help @copyfiles-help)
- (source "bin")
- (dest UUBIN)
- (choices "smail_axsh" "mail_axsh" "convert" "batch_smtp")
- (infos)
- (confirm))
- (set smail2 (tackon UUBIN "smail_axsh"))
- (set mail2 (tackon UUBIN "mail_axsh"))
- (set axsh 1)
- (debug (run (cat "c:rename from="smail2" to="smail)))
- (debug (run (cat "c:rename from="mail2" to="mail)))
- )
- )
-
- (if (= choice 2)
- (
- (copyfiles
- (prompt "Install MUFS programs...")
- (help @copyfiles-help)
- (source "bin")
- (dest UUBIN)
- (choices "smail_mufs" "mail_mufs" "convert" "batch_smtp")
- (infos)
- (confirm))
- (set smail2 (tackon UUBIN "smail_mufs"))
- (set mail2 (tackon UUBIN "mail_mufs"))
- (set axsh 2)
- (debug (run (cat "c:rename from="smail2" to="smail)))
- (debug (run (cat "c:rename from="mail2" to="mail)))
- )
- )
-
- ;================== generate rmail and sendmail =================
- (complete 60)
- (debug (run (cat "delete force "rmail)))
- (debug (run (cat "delete force "sendmail)))
- (if (= 0 (askchoice
- (prompt "sendmail, rmail, rsmtp, rcsmtp and rfsmtp\nare the same programs as smail\n")
- (choices "generate a hardlink"
- "generate copies")
- (default 0)
- (help "If you use Hardlinks there could(!) be problems with "
- "your filesystem, because hardlinks are not fully "
- "supported by the OS.")
- )
- )
- (
- (debug (run (cat "c:Makelink to="smail" from="rmail)))
- (debug (run (cat "c:Makelink to="smail" from="sendmail)))
- (debug (run (cat "c:Makelink to="smail" from="rsmtp)))
- (debug (run (cat "c:Makelink to="smail" from="rcsmtp)))
- (debug (run (cat "c:Makelink to="smail" from="rfsmtp)))
- )
- (
- (debug (run (cat "c:copy clone from="smail" to="rmail)))
- (debug (run (cat "c:copy clone from="smail" to="sendmail)))
- (debug (run (cat "c:copy clone from="smail" to="rsmtp)))
- (debug (run (cat "c:copy clone from="smail" to="rcsmtp)))
- (debug (run (cat "c:copy clone from="smail" to="rfsmtp)))
- )
- )
- ;=================== generate the uulib:config entries ==========
- (complete 80)
-
- (set uuconfig (askbool
- (prompt " Do you want to install or modify the uulib:config"
- " entries for Smail ?\n"
- " If you don't use this option please refer to Smail.guide "
- " chapter \"Misc/Config options\" and modify the options "
- " according to your wishes.")
- (choices "Proceed" "Skip this Part")
- (default 0)
- (help " If you select \"Skip this Part\" the installer script "
- " will not modify your uulib:config. If you select \"Proceed\""
- " the installer script will ask you some questions and will "
- " include the Smail options to your uulib:config file." )
- ))
-
- (if (= uuconfig 1)
- (
- (set tmp (tackon UULIB "mail"))
- (if (NOT (= (exists tmp (noreq)) 2))
- (debug (run (cat "makedir " tmp)))
- )
-
- (set tmp (tackon UUSPOOL "batch"))
- (if (NOT (= (exists tmp (noreq)) 2))
- (debug (run (cat "makedir " tmp)))
- )
-
- (set line1
- (askstring
- (prompt "The name of your smarthost (with domain)?")
- (default "foo.bar")
- (help "The host, that receives all mails from you, "
- "which can't be found in the path file")
- )
- )
-
- (set line2
- (askfile
- (prompt "Where should the DillonUUCP styled logfile should go (use a emtpy string for NIL:)?\n")
- (help "You can use your normal DillonUUCP logfile uuspool:logfile "
- "or define a new one. Don't forget from time to time to trim this file.")
- (default "uuspool:logfile")
- )
- )
-
- (set line3
- (askfile
- (prompt "Where should the CNews styled logfile should go (use a emtpy string for NIL:)? ")
- (help "It uses nearly the same syntax as CNews. The main difference "
- "to DillonUUCP styled logfile is, that you can see, whether "
- "a mail transport was successful.")
- (default "uulib:mail/logfile")
- )
- )
-
- (set line4
- (askfile
- (prompt "Where should the logfile with the full mailbody should go (use a emtpy string for NIL:)?")
- (help "In this logfile smail logs all mail delivery with the fully mail "
- "body. Normally you should only use this option for debugging")
- (default "t:smail.log")
- )
- )
-
- (if (= 0 axsh)
- (set line5
- (askfile
- (prompt "Where is the Getty passwd file ?\n")
- (help "GETTY:PASSWD is similar to the UNIX /etc/passwd file and is "
- "currently used by Getty to verify remote logins and run the "
- "appropriate 'shell', which in most cases will be uucico. The "
- "format is:\n\n"
- "------ start of GETTY:PASSWD -----\n"
- "# Put any comment here\n"
- "#\n"
- "# User,Password,Uid,GroupId,Finger-Info,Home-Dir,Command-To-Run\n"
- "bbs,*,10,0,BBS,ram:,mybbs:c/mybbs\n")
- (default "getty:passwd")
- )
- )
- )
-
- (set line6
- (askfile
- (prompt "Where is your alias file ?\n")
- (help "This file contains a list of aliases for local users or "
- "mailing lists. The format of each alias is\n"
- " alias_name recip_name1 recip_name2 ... ")
- (default "uulib:mail/aliases")
- )
- )
-
- (set line12
- (askfile
- (prompt "Where is/should your path file ?\n")
- (help "Look at smail.guide for more help")
- (default "uulib:mail/paths")
- )
- )
-
- (set line7
- (askchoice
- (choices "use rerouting" "don't use rerouting" "don't route anything")
- (prompt "Rerouting ability ?\n")
- (help " 'don't use rerouting' causes smail/rmail to attempt to route the first "
- " component of a UUCP path, probably so it can impress people "
- " with how many UUCP hosts it knows. If this fails, it passes "
- " the unrouted address to uux, in case the path database is "
- " not complete. 'use rerouting' causes smail/rmail to take a UUCP "
- " path and route the rightmost component of the path (save the "
- " user name) possible. This is mostly for hosts that have "
- " very up-to-date routing tables.")
- (default 0)
- )
- )
-
- (set line8
- (if
- (= 0
- (askchoice
- (choices "Return-To-Receipt Headers" "ignore Return-To-Receipt Headers")
- (prompt "Return-To-Receipt Headers...\n")
- (help "smail/rmail will send an mail with a copy of the header "
- "of the original mail to the address after the Return-To-Receipt: "
- "Header. You can turn this off via the SMReceipt keyword in the "
- "uulib:config file. See smail.guide for the recognition "
- "whether a user exists on your site.")
- (default 0)
- )
- )
- ("Yes")
- ("No")
- )
- )
-
- (set nr
- (askchoice
- (choices "compress" "gzip" "freeze" "none")
- (prompt "Which command should smail/rmail\nuse to compress the BSMTP mails ?\n")
- (help "The command to compress your BSMTP mails. "
- "The command is:\nexecute cmd <infile >outfile")
- (default 1)
- )
- )
-
- (if (<> 3 nr)
- (set line9
- (askfile
- (prompt "Where is your compress command ?\n")
- (help "I need the complete path of the command. ")
- (default "compress")
- )
- )
- )
-
- ; compress
- (if (= 0 nr)
- (set line10 "rcsmtp")
- )
- ; gzip
- (if (= 1 nr)
- (set line10 "rcsmtp")
- )
- ; freeze
- (if (= 2 nr)
- (set line10 "rfsmtp")
- )
- ; none
- (if (= 3 nr)
- (set line10 "rsmtp")
- )
-
- (set line11
- (askfile
- (prompt "Where is the file, with your BSMTP sites ?\n")
- (help "The file with all hosts, which receives mails via BSMTP. Simply one site by every line.")
- (default "uulib:mail/bsmtp_sites")
- )
- )
-
- (set line14
- (if
- (= 0
- (askchoice
- (choices "no restrictions" "restrictions")
- (prompt "Smail offers you the opportunity to allow only "
- "to some local users to write mail via UUCP/BSMTP")
- (help "See smail.guide")
- (default 0)
- )
- )
- ("No")
- ("Yes")
- )
- )
-
- (if (<> choice 2)
- (if (= line14 "Yes")
- (set line13
- (askfile
- (prompt "Where is the file, with your local users which are allowed to mail outsite your site?")
- (help "The file with all users which are allowed to mail via UUCP/BSMTP. Simply one user by every line.")
- (default "uulib:mail/checkuser")
- )
- )
- )
- )
-
- (textfile
- (dest "t:add_to_config")
- (prompt "Generating new "UULIB"config file")
- (include (tackon UULIB "config"))
- (append "\n# Options for SMail\n")
- (append "SMDebug 0\n")
- (append "SMSmarthost ")
- (append line1)
- (append "\n")
- (append "SMLogfile ")
- (if (= "" line2)
- (append "NIL:")
- (append line2)
- )
- (append "\n")
- (append "SMMaillogfile ")
- (if (= "" line3)
- (append "NIL:")
- (append line3)
- )
- (append "\n")
- (append "SMSentlog ")
- (if (= "" line4)
- (append "NIL:")
- (append line4)
- )
- (append "\n")
- (append "SMAlias ")
- (append line6)
- (append "\n")
- (if (= 0 axsh)
- (
- (append "SMPasswd ")
- (append line5)
- (append "\n")
- )
- )
- (append "SMPath ")
- (append line12)
- (append "\n")
- (append "SMRerouting ")
- (append line7)
- (append "\n")
- (append "SMReceipt ")
- (append line8)
- (append "\n")
- (if (<> nr 3)
- (
- (append "SMCompress ")
- (append line9)
- (append "\n")
- )
- )
- (append "SMBsmtpCmd ")
- (append line10)
- (append "\n")
- (append "SMBsmtpSites ")
- (append line11)
- (append "\n")
- (append "SMCheckuser ")
- (append line14)
- (append "\n")
- (if (<> choice 2)
- (if (= line14 "Yes")
- (
- (append "SMCheckFile ")
- (append line13)
- (append "\n")
- )
- )
- )
- )
-
- (run "copy uulib:config uulib:config.o")
- (run "copy t:add_to_config uulib:config")
- (run "delete t:add_to_config")
- )
- )
- ;=================== showing AmigaGuide ==================
- (run "run AmigaGuide smail.guide"
- (prompt "Running AmigaGuide smail.guide.")
- (safe)
- )
-
- ;=================== sending the accounting mail =========
- (debug (run ("c:echo >t:smail_version")))
- (debug (run ("c:echo >>t:smail_version \"Version strings of the commands\"")))
- (debug (run (cat "c:Version >>t:smail_version full "smail)))
- (debug (run (cat "c:Version >>t:smail_version full "mail)))
- (debug (run (cat "c:Version >>t:smail_version full "batch_smtp)))
-
- (debug (run ("c:echo >t:smail_run stack 80000")))
- (debug (run (cat "c:echo >>t:smail_run \""sendmail" <t:smail_version -t smail@mavhh.hanse.de -s SMail_account_msg\"")))
-
- (run ("c:execute t:smail_run sendmail"))
-
- (run "c:delete t:smail_version")
- (run "c:delete t:smail_run")
-
- (complete 100)
- (exit "SMail is now (hopefully correct) installed. "
- "You should edit/setup the paths file. Please read the "
- "\"Installation/Setup a pathfile\" section in smail.guide. "
- "Copys of your previous smail/rmail etc programs can be found in t:.\n"
- "Attention !!! This Installer script sends a mail with the version strings "
- "of the installed programs to a special account (smail@mavhh.hanse.de) "
- "at the site of the smail programmer. "
- )
-